--FIRST EXAMPLES

IF OBJECT_ID('tempdb..#SampleXML') IS NOT NULL DROP TABLE #SampleXML
CREATE TABLE #SampleXML (SampleXMLID INT PRIMARY KEY IDENTITY (1,1), Test VARCHAR(50), TestXML XML)

INSERT INTO #SampleXML (Test, TestXML) VALUES
('elements','<root><element></element></root>'),
('Empty Elements','<root><element></element></root>'),
('Attributes','<root><element id="1"></element><element id="2" someOtherAttribute="Test"></element></root>'),
('Content','<root><element>content</element></root>'),
('Comments','<root><element></element><!-- This is a comment placed randomly --></root>')

SELECT * FROM #SampleXML

DECLARE @SampleXMLVariable XML = '<root><element>somevalue</element></root>'

INSERT INTO #SampleXML (Test, TestXML) VALUES ('From a Variable',@SampleXMLVariable)

SELECT * FROM #SampleXML
